<?php
/**
 * @author 天涯 <mail@phpha.com>
 * @copyright http://blog.phpha.com
 * @link http://blog.phpha.com/vncms
 * @version 1.0
 */
defined('APP_PATH') or exit('Access Denied');
require 'check.php';
class conf extends check{
	//更新配置
	public function upd(){
		$this->conf = spClass('m_conf')->find();
		$this->display('conf_upd.tpl.php');
	}
	//执行更新
	public function doupd(){
		if(!$sitename = trim($this->spArgs('sitename')))	$this->error('站点名称必填！',spUrl('conf','upd'));
		$conf = spClass('m_conf')->find();
		$sitename = $conf['sitename'];
		if(false != spClass('m_conf')->update(array('sitename'=>$sitename),$this->spArgs())){
			$this->success('更新成功！',spUrl('conf','upd'));
		}else{
			$this->error('更新失败！',spUrl('conf','upd'));
		}
	}
}
